/**
 * 
 * @author Taylor Zielske
 * @author Mihn Thai
 *
 */
public class OurVertex extends Vertex implements Comparable{
	private Vertex neighborVertex;
	private int binaryheapindex;
	private boolean known; // is in the known set
	//pointer to point to position of vertex in binary heap
	// so it can be updated in constant time
	
	public OurVertex(Vertex v, double w, String vertexname){
		super(w, vertexname);
		this.neighborVertex = v;
		//this.path = neighborVertex;
		//this.known = false;
	}

	public Vertex getVertex() {
		return this.neighborVertex;
	}

	public void setVertex(Vertex vertex) {
		this.neighborVertex = vertex;
	}
	public int getIndex(){
		return binaryheapindex;
	}
	public void setIndex(int index){
		this.binaryheapindex = index;
	}

	public double getWeight() {
		return (Double) super.getData();
	}

	public void setWeight(double weight) {
		super.setData(weight);
	}
	@Override
	public int compareTo(Object o) {
		if (o instanceof Vertex) {
			Vertex temp = (Vertex) o;
			double x1 = (Double) this.getData();
			double x2 = (Double) temp.getData();
			if (x1 == x2) {
				return 0;
			}else if (x1 > x2) {
				return 1;
			}else { //x1 < x2
				return -1;
			}
		}
		return -1;
	}
	
}
